package com.aiti.ai.dto.ai;

import lombok.Data;

import java.util.List;
import java.util.Objects;

/**
 * @description: SearXNGWebSearchResponse
 * @auth fcb
 * @date 2025-03-19 16:27
 **/
@Data
public class SearXNGWebSearchResponse {

    private String query;
    private Integer number_of_results;
    private List<Results> results;
    private List<String> answers;
    private List<String> corrections;
    private List<String> infoboxes;
    private List<String> suggestions;
    //private List<String> unresponsive_engines;

    @Data
    public static class Results {
        private String title;
        private String url;
        private String content;
        private String publishedDate;
        private String engine;
        private String template;
        private List<String> parsed_url;
        private String img_src;
        private String thumbnail;
        private String priority;
        private List<String> engines;
        private List<Integer> positions;
        private Double score;
        private String category;

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Results results = (Results) o;
            return Objects.equals(url, results.url);
        }

        @Override
        public int hashCode() {
            return Objects.hash(url);
        }
    }
}
